package edu.aysf.controller;

import edu.aysf.entity.DoctorEntity;
import edu.aysf.service.DoctorService;
import edu.aysf.service.impl.DoctorServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: 郑老师
 * @Version: 1.0
 * @Date: 2024-10-15 18:19:40
 * @Desc:
 **/
@RestController
//@RequestMapping(path = "/doctor", method = RequestMethod.GET)
@RequestMapping(path = "/doctor")
public class DoctorController {

    @Autowired
    private DoctorService doctorService ;

//    @Autowired
//    private DoctorServiceImpl doctorService ;

    /*
     * @Author 郑老师
     * @Desc   过得医生的个人信息
     * @Date 2024-10-17 10:19
     * @Param
     * @UpdateInfo
     */
    @RequestMapping("/info")
//    @GetMapping("/info")
    public  Map  getDoctorInfo(){
        List<DoctorEntity> listDoctor = doctorService.selectDoctorInfo();

        // 因为前后端商量的传数据格式是map,所以这里new一个hashmap
        HashMap<Object, Object> hashMap = new HashMap<>();
        hashMap.put("list",listDoctor);
        return hashMap;
    }

}
